home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagn_r.zip / NETWORK.SWG / 0013_Novell Detection.pas < prev    next >
Pascal/Delphi Source File  |  1994-01-27  |  4KB  |  87 lines

  1. {
  2. > Is there a way to detect if a system is running under Novell
  3. > Netware? There must be an interrupt to do that, but wich one?
  4.  
  5.  
  6.      Yes there is.  Although this is in assembly, I'm sure you can dig
  7. out what you need and convert it to Pascal or inline ASM. I've also
  8. included for the more common multitaskers. I always try to check for
  9. each at the beginning of a program so I can code to take advantage of
  10. the features of whatever system it's operating under, or at least
  11. prevent problems.
  12. }
  13.  
  14. ;*****************************************************************
  15. ;*    Check to see if we are running under a Novell Network      *
  16. ;*****************************************************************
  17. .public     chk_novell
  18. .proc       chk_novell  auto
  19.     .push   es,di               ; Protect the registers well use
  20.     xor     ax,ax               ; and clear them
  21.     push    ax
  22.     push    ax
  23.     .pop    es,di
  24.     mov     ax,07A00H           ; Novel Netware installation check
  25.     int     2FH                 ; Check it
  26.     or      al,al               ; If installed, al = 0FFH
  27.                                 ;  ES:DI ptr -> far entry point for
  28.                                 ;  routines otherwise accessed through
  29.                                 ;  INT 21H
  30.     jnz     double_check        ; Appears to be installed, see if there
  31.                                 ;  is a far address in ES:DI
  32.     stc                         ; Set carry to indicate no network
  33.     .pop    es,di               ; restore what we used
  34.     ret                         ; and exit
  35. double_check:
  36.     push    di                  ; Check
  37.     pop     ax
  38.     or      ax,ax               ; Is it empty
  39.     jnz     in_novell           ; No has pointer so were in a network
  40.     push    es
  41.     pop     ax
  42.     or      ax,ax               ; Is it empty
  43.     jnz     in_novell           ; No has pointer
  44.     stc                         ; No pointer to far address so no network
  45.                                 ;  Chance of a ptr to 0000:0000 are
  46.                                 ;  basically non-existant
  47. in_novell:
  48.     .pop    es,di               ; Clean up after ourselves
  49.     ret                         ; and go home
  50. .endp       chk_novell
  51. ;***********************************************************************
  52. ;* Check to see if we are running under Desqview, TopView, or TaskView *
  53. ;***********************************************************************
  54. .public     chk_desq
  55. .proc       chk_desq  auto
  56.     .push   ax,bx               ; Save registers we will use
  57.     mov     ax,1022H            ; This is the get version function
  58.                                 ;  that TopView installs for Int 15H.
  59.                                 ;  Most TopView compatibles use the
  60.                                 ;  same function so we can check for
  61.                                 ;  several with just one call
  62.     xor     dx,dx               ; Clear dx
  63.     int     15H                 ; Make the call
  64.     cmp     bx,0a01H            ; DesqView 2.x returns 0A01H
  65.     jnz     try_task            ; Did we get it
  66.     mov     @dataseg:Desqview,1 ; YES, save it and go home
  67.     jmp     short No_View
  68. try_task:                       ; No, Try TaskView
  69.     cmp     bx,0001H            ; TaskView Returns 0001H
  70.     jnz     try_top             ; Get it
  71.     mov     @dataseg:TaskView,1 ; Yes
  72.     jmp     short No_View
  73. try_top:                        ; No, try TopView. Top View returns it's
  74.     or      bx,bx               ; version so just test for non-zero
  75.     jz      No_View             ; is it non-zero
  76.     mov     @dataseg:TopView,1  ; Yes, save it
  77. No_View:
  78.     .pop    ax,bx               ; Restore regs and go home
  79.     ret
  80. .endp       chk_desq
  81.  
  82. {
  83.    Hope this helps. BTW, I don't know about the later versions of
  84. Windows, but the older versions respected the Desqview installation
  85. check.
  86. }
  87.